//
//  MovieView.m
//  GuoBang
//
//  Created by fengshuai on 16/5/3.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "MovieView.h"

@implementation MovieView



-(instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(26, 25, 30, 30)];
        [self addSubview:self.imageV];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.imageV.frame) + 25, 16, 70, 14)];
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        self.titleLabel.textColor = RGBCOLOR(69, 69, 69);
        [self addSubview:self.titleLabel];
        
        
        self.detailsLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.titleLabel.frame), CGRectGetMaxY(self.titleLabel.frame) + 14, 200, 14)];
        
        self.detailsLabel.font = [UIFont systemFontOfSize:14];
        self.detailsLabel.textColor = RGBCOLOR(69, 69, 69);
        [self addSubview:self.detailsLabel];
        
        self.dingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        self.dingBtn.frame = CGRectMake(self.frame.size.width - 60, 10, 60, 60);
     
        [self.dingBtn addTarget:self action:@selector(dingAction:) forControlEvents:UIControlEventTouchUpInside];
        
         self.frame=CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, self.detailsLabel.frame.size.height+self.detailsLabel.frame.origin.y+10);
        
        [self addSubview:self.dingBtn];
        
        
    }
    
    return self;
    
    
    
    
}




-(id)initWithFrame:(CGRect)frame withImage:(UIImage *)image title:(NSString *)title detailsTitle:(NSString *)detailsTitle buttonImage:(UIImage *)btnimage
{
    self = [self initWithFrame:frame];
    if (self) {
  
        self.titleLabel.text = title;
        self.detailsLabel.text = detailsTitle;
        self.imageV.image = image;
        [self.dingBtn setImage:btnimage forState:UIControlStateNormal];
        
    }
    
    return self;
}


- (void)dingAction:(UIButton *)sender
{
    
    
    
    
    
    
    
}


@end
